package com.example.demo.thread;

public class Consumer {
    Depository depository;

    public Consumer(Depository depository) {
        this.depository = depository;
    }

    public void consume(Integer id, final int count) {
        new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    depository.consume(id, count);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }).start();
    }
}
